<?PHP
require_once ("./include/membersite_config.php");
$message = '';
$showLogedNavbar = true;
$error = false;
if (! $fgmembersite->CheckLogin ()) {
	$showLogedNavbar = false;
}

$_SESSION ['id_of_user'] = $fgmembersite->UserId ();

if (! $fgmembersite->FetchRanking ($_SESSION ['id_of_user'])) {
	$error = true;
	$message = "The error is: " . $fgmembersite->GetErrorMessage ();
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head>
<meta http-equiv='Content-Type' content='text/html' charset='iso-8859-1' />
<title>Trivia</title>
<?php include 'imports.php'?>
<script type="text/javascript" src="scripts/jQueryLib/jquery.bootpag.min.js"></script>
</head>
<body>
<?php if($showLogedNavbar){
 
	include 'navbar.php'; 
}else{
	include 'navbarOutside.php';

}?>
 	<div class="container">
		<div class="row clearfix">
		    <div id='some_id' class="well">
                <div id="content"> 
                    <script>
                        $("#content").load("rankpage.php?page="+ <?php echo $_SESSION['currpage']; ?>);
                    </script>
                </div>
                
                <div id="rank"> 
					<script>
                        // init bootpag
                        $('#rank').bootpag({
                            total: <?php echo $_SESSION['rankpages']; ?>,
                            page: <?php echo $_SESSION['currpage']+1; ?>,
                            maxVisible:10
                        }).on("page", function(event, /* page number here */ num){
                             $("#content").load("rankpage.php?page="+(num-1)); // some ajax content loading...
                        });
                    </script>
                </div>
            </div>
		</div>
	</div>
</body>
</html>
